package c.d.a.a.i;

import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Paint.Align;
import android.graphics.Paint.FontMetrics;
import android.graphics.Paint.Style;
import android.graphics.Path;
import android.graphics.PathEffect;
import c.d.a.a.b.e;
import c.d.a.a.b.e.b;
import c.d.a.a.b.f;
import c.d.a.a.f.b.a;
import c.d.a.a.f.b.c;
import c.d.a.a.j.g;
import c.d.a.a.j.h;
import com.github.mikephil.charting.data.PieEntry;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/* compiled from: LegendRenderer */
public class d extends j {
    public Paint b;
    public Paint c;
    public e d;
    public List<f> e = new ArrayList(16);
    public FontMetrics f = new FontMetrics();
    public Path g = new Path();

    public d(h hVar, e eVar) {
        super(hVar);
        this.d = eVar;
        Paint paint = new Paint(1);
        this.b = paint;
        paint.setTextSize(g.d(9.0f));
        this.b.setTextAlign(Align.LEFT);
        paint = new Paint(1);
        this.c = paint;
        paint.setStyle(Style.FILL);
    }

    public void a(c.d.a.a.c.d<?> dVar) {
        int i;
        int i2;
        float d;
        f fVar;
        String str;
        f fVar2;
        c.d.a.a.c.d<?> dVar2 = dVar;
        b bVar = b.NONE;
        Objects.requireNonNull(this.d);
        this.e.clear();
        for (i = 0; i < dVar.d(); i++) {
            c.d.a.a.f.b.d c = dVar2.c(i);
            List y = c.y();
            int i0 = c.i0();
            if (c instanceof a) {
                a aVar = (a) c;
                if (aVar.U()) {
                    String[] W = aVar.W();
                    i0 = 0;
                    while (i0 < y.size() && i0 < aVar.A()) {
                        this.e.add(new f(W[i0 % W.length], c.J(), c.w0(), c.p0(), c.C(), ((Integer) y.get(i0)).intValue()));
                        i0++;
                    }
                    if (aVar.N() != null) {
                        this.e.add(new f(c.N(), bVar, Float.NaN, Float.NaN, null, 1122867));
                    }
                }
            }
            int i3;
            if (c instanceof c.d.a.a.f.b.h) {
                c.d.a.a.f.b.h hVar = (c.d.a.a.f.b.h) c;
                i3 = 0;
                while (i3 < y.size() && i3 < i0) {
                    this.e.add(new f(((PieEntry) hVar.q0(i3)).d, c.J(), c.w0(), c.p0(), c.C(), ((Integer) y.get(i3)).intValue()));
                    i3++;
                }
                if (hVar.N() != null) {
                    this.e.add(new f(c.N(), bVar, Float.NaN, Float.NaN, null, 1122867));
                }
            } else {
                if (c instanceof c) {
                    c cVar = (c) c;
                    if (cVar.y0() != 1122867) {
                        int y0 = cVar.y0();
                        int Y = cVar.Y();
                        this.e.add(new f(null, c.J(), c.w0(), c.p0(), c.C(), y0));
                        this.e.add(new f(c.N(), c.J(), c.w0(), c.p0(), c.C(), Y));
                    }
                }
                i3 = 0;
                while (i3 < y.size() && i3 < i0) {
                    String N;
                    if (i3 >= y.size() - 1 || i3 >= i0 - 1) {
                        N = dVar2.c(i).N();
                    } else {
                        N = null;
                    }
                    this.e.add(new f(N, c.J(), c.w0(), c.p0(), c.C(), ((Integer) y.get(i3)).intValue()));
                    i3++;
                }
            }
        }
        Objects.requireNonNull(this.d);
        e eVar = this.d;
        List list = this.e;
        Objects.requireNonNull(eVar);
        eVar.f = (f[]) list.toArray(new f[list.size()]);
        Objects.requireNonNull(this.d);
        this.b.setTextSize(this.d.d);
        this.b.setColor(this.d.e);
        eVar = this.d;
        Paint paint = this.b;
        h hVar2 = this.a;
        float d2 = g.d(eVar.l);
        float d3 = g.d(eVar.p);
        float d4 = g.d(eVar.o);
        float d5 = g.d(eVar.n);
        float d6 = g.d(0.0f);
        f[] fVarArr = eVar.f;
        int length = fVarArr.length;
        g.d(eVar.o);
        float f = 0.0f;
        float f2 = 0.0f;
        for (f fVar3 : eVar.f) {
            d = g.d(Float.isNaN(fVar3.c) ? eVar.l : fVar3.c);
            if (d > f) {
                f = d;
            }
            String str2 = fVar3.a;
            if (str2 != null) {
                d = (float) ((int) paint.measureText(str2));
                if (d > f2) {
                    f2 = d;
                }
            }
        }
        float f3 = 0.0f;
        for (f fVar22 : eVar.f) {
            str = fVar22.a;
            if (str != null) {
                float a = (float) g.a(paint, str);
                if (a > f3) {
                    f3 = a;
                }
            }
        }
        eVar.t = f3;
        int ordinal = eVar.i.ordinal();
        b bVar2;
        FontMetrics fontMetrics;
        float f4;
        if (ordinal == 0) {
            float f5;
            f = d2;
            bVar2 = bVar;
            fontMetrics = g.f;
            paint.getFontMetrics(fontMetrics);
            float f6 = fontMetrics.descent - fontMetrics.ascent;
            fontMetrics = g.f;
            paint.getFontMetrics(fontMetrics);
            d2 = ((fontMetrics.ascent - fontMetrics.top) + fontMetrics.bottom) + d6;
            hVar2.b();
            eVar.v.clear();
            eVar.u.clear();
            eVar.w.clear();
            f4 = 0.0f;
            int i4 = 0;
            f3 = 0.0f;
            i = -1;
            d6 = 0.0f;
            while (i4 < length) {
                Paint paint2;
                fVar22 = fVarArr[i4];
                float f7 = d5;
                Object obj = fVar22.b != bVar2 ? 1 : null;
                if (Float.isNaN(fVar22.c)) {
                    d5 = f;
                } else {
                    d5 = g.d(fVar22.c);
                }
                str = fVar22.a;
                f[] fVarArr2 = fVarArr;
                f5 = d2;
                eVar.v.add(Boolean.FALSE);
                f4 = i == -1 ? 0.0f : f4 + d3;
                if (str != null) {
                    eVar.u.add(g.b(paint, str));
                    f4 = (f4 + (obj != null ? d4 + d5 : 0.0f)) + ((c.d.a.a.j.b) eVar.u.get(i4)).b;
                    paint2 = paint;
                } else {
                    paint2 = paint;
                    eVar.u.add(c.d.a.a.j.b.b(0.0f, 0.0f));
                    if (obj == null) {
                        d5 = 0.0f;
                    }
                    f4 += d5;
                    if (i == -1) {
                        i = i4;
                    }
                }
                if (str != null || i4 == length - 1) {
                    d6 += (d6 == 0.0f ? 0.0f : f7) + f4;
                    if (i4 == length - 1) {
                        eVar.w.add(c.d.a.a.j.b.b(d6, f6));
                        f3 = Math.max(f3, d6);
                    }
                }
                if (str != null) {
                    i = -1;
                }
                i4++;
                d5 = f7;
                fVarArr = fVarArr2;
                d2 = f5;
                paint = paint2;
            }
            f5 = d2;
            eVar.r = f3;
            f6 *= (float) eVar.w.size();
            if (eVar.w.size() == 0) {
                i2 = 0;
            } else {
                i2 = eVar.w.size() - 1;
            }
            eVar.s = (f5 * ((float) i2)) + f6;
        } else if (ordinal == 1) {
            fontMetrics = g.f;
            paint.getFontMetrics(fontMetrics);
            f4 = fontMetrics.descent - fontMetrics.ascent;
            d = 0.0f;
            d5 = 0.0f;
            f3 = 0.0f;
            i = 0;
            Object obj2 = null;
            while (i < length) {
                fVar3 = fVarArr[i];
                f = d2;
                f2 = f3;
                Object obj3 = fVar3.b != bVar ? 1 : null;
                if (Float.isNaN(fVar3.c)) {
                    f3 = f;
                } else {
                    f3 = g.d(fVar3.c);
                }
                String str3 = fVar3.a;
                if (obj2 == null) {
                    f2 = 0.0f;
                }
                if (obj3 != null) {
                    if (obj2 != null) {
                        f2 += d3;
                    }
                    f2 += f3;
                }
                bVar2 = bVar;
                float f8 = f2;
                if (str3 != null) {
                    if (obj3 != null && obj2 == null) {
                        d2 = f8 + d4;
                    } else if (obj2 != null) {
                        d = Math.max(d, f8);
                        d5 += f4 + d6;
                        d2 = 0.0f;
                        obj2 = null;
                    } else {
                        d2 = f8;
                    }
                    d2 += (float) ((int) paint.measureText(str3));
                    if (i < length - 1) {
                        d5 = (f4 + d6) + d5;
                    }
                    f3 = d2;
                } else {
                    f8 += f3;
                    if (i < length - 1) {
                        f8 += d3;
                    }
                    f3 = f8;
                    obj2 = 1;
                }
                d = Math.max(d, f3);
                i++;
                d2 = f;
                bVar = bVar2;
            }
            eVar.r = d;
            eVar.s = d5;
        }
        eVar.s += eVar.c;
        eVar.r += eVar.b;
    }

    public void b(Canvas canvas, float f, float f2, f fVar, e eVar) {
        int i = fVar.f;
        if (i != 1122868 && i != 1122867 && i != 0) {
            float f3;
            i = canvas.save();
            Enum enumR = fVar.b;
            if (enumR == b.DEFAULT) {
                enumR = eVar.k;
            }
            this.c.setColor(fVar.f);
            if (Float.isNaN(fVar.c)) {
                f3 = eVar.l;
            } else {
                f3 = fVar.c;
            }
            f3 = g.d(f3);
            float f4 = f3 / 2.0f;
            int ordinal = enumR.ordinal();
            if (ordinal != 2) {
                if (ordinal == 3) {
                    this.c.setStyle(Style.FILL);
                    canvas.drawRect(f, f2 - f4, f + f3, f2 + f4, this.c);
                } else if (ordinal != 4) {
                    if (ordinal == 5) {
                        float f5;
                        if (Float.isNaN(fVar.d)) {
                            f5 = eVar.m;
                        } else {
                            f5 = fVar.d;
                        }
                        f5 = g.d(f5);
                        PathEffect pathEffect = fVar.e;
                        if (pathEffect == null) {
                            Objects.requireNonNull(eVar);
                            pathEffect = null;
                        }
                        this.c.setStyle(Style.STROKE);
                        this.c.setStrokeWidth(f5);
                        this.c.setPathEffect(pathEffect);
                        this.g.reset();
                        this.g.moveTo(f, f2);
                        this.g.lineTo(f + f3, f2);
                        canvas.drawPath(this.g, this.c);
                    }
                }
                canvas.restoreToCount(i);
            }
            this.c.setStyle(Style.FILL);
            canvas.drawCircle(f + f4, f2, f4, this.c);
            canvas.restoreToCount(i);
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:107:0x0283  */
    /* JADX WARNING: Removed duplicated region for block: B:95:0x0235  */
    /* JADX WARNING: Removed duplicated region for block: B:39:0x012d  */
    /* JADX WARNING: Removed duplicated region for block: B:39:0x012d  */
    /* JADX WARNING: Removed duplicated region for block: B:95:0x0235  */
    public void c(android.graphics.Canvas r40) {
        /*
        r39 = this;
        r6 = r39;
        r7 = r40;
        r8 = c.d.a.a.b.e.b.NONE;
        r9 = c.d.a.a.b.e.c.CENTER;
        r0 = c.d.a.a.b.e.d.VERTICAL;
        r10 = c.d.a.a.b.e.a.LEFT_TO_RIGHT;
        r11 = c.d.a.a.b.e.a.RIGHT_TO_LEFT;
        r1 = r6.d;
        r2 = r1.a;
        if (r2 != 0) goto L_0x0015;
    L_0x0014:
        return;
    L_0x0015:
        r2 = r6.b;
        r1 = r1.d;
        r2.setTextSize(r1);
        r1 = r6.b;
        r2 = r6.d;
        r2 = r2.e;
        r1.setColor(r2);
        r1 = r6.b;
        r2 = r6.f;
        r3 = c.d.a.a.j.g.a;
        r1.getFontMetrics(r2);
        r1 = r2.descent;
        r2 = r2.ascent;
        r12 = r1 - r2;
        r1 = r6.b;
        r2 = r6.f;
        r1.getFontMetrics(r2);
        r1 = r2.ascent;
        r3 = r2.top;
        r1 = r1 - r3;
        r2 = r2.bottom;
        r1 = r1 + r2;
        r2 = r6.d;
        java.util.Objects.requireNonNull(r2);
        r13 = 0;
        r2 = c.d.a.a.j.g.d(r13);
        r14 = r2 + r1;
        r1 = r6.b;
        r2 = "ABC";
        r1 = c.d.a.a.j.g.a(r1, r2);
        r1 = (float) r1;
        r15 = 1073741824; // 0x40000000 float:2.0 double:5.304989477E-315;
        r1 = r1 / r15;
        r16 = r12 - r1;
        r1 = r6.d;
        r5 = r1.f;
        r1 = r1.o;
        r4 = c.d.a.a.j.g.d(r1);
        r1 = r6.d;
        r1 = r1.n;
        r3 = c.d.a.a.j.g.d(r1);
        r1 = r6.d;
        r2 = r1.i;
        r13 = r1.g;
        r15 = r1.h;
        r19 = r14;
        r14 = r1.j;
        r1 = r1.l;
        r20 = c.d.a.a.j.g.d(r1);
        r1 = r6.d;
        r1 = r1.p;
        r1 = c.d.a.a.j.g.d(r1);
        r21 = r1;
        r1 = r6.d;
        r22 = r3;
        r3 = r1.c;
        r1 = r1.b;
        r23 = r4;
        r4 = r13.ordinal();
        r7 = 1;
        if (r4 == 0) goto L_0x010f;
    L_0x009c:
        if (r4 == r7) goto L_0x00c4;
    L_0x009e:
        r7 = 2;
        if (r4 == r7) goto L_0x00a8;
    L_0x00a1:
        r28 = r5;
        r25 = r8;
        r7 = 0;
        goto L_0x0127;
    L_0x00a8:
        if (r2 != r0) goto L_0x00af;
    L_0x00aa:
        r0 = r6.a;
        r0 = r0.c;
        goto L_0x00b5;
    L_0x00af:
        r0 = r6.a;
        r0 = r0.b;
        r0 = r0.right;
    L_0x00b5:
        r0 = r0 - r1;
        if (r14 != r10) goto L_0x00bd;
    L_0x00b8:
        r1 = r6.d;
        r1 = r1.r;
        r0 = r0 - r1;
    L_0x00bd:
        r7 = r0;
        r28 = r5;
        r25 = r8;
        goto L_0x0127;
    L_0x00c4:
        if (r2 != r0) goto L_0x00ce;
    L_0x00c6:
        r4 = r6.a;
        r4 = r4.c;
        r7 = 1073741824; // 0x40000000 float:2.0 double:5.304989477E-315;
        r4 = r4 / r7;
        goto L_0x00df;
    L_0x00ce:
        r7 = 1073741824; // 0x40000000 float:2.0 double:5.304989477E-315;
        r4 = r6.a;
        r7 = r4.b;
        r7 = r7.left;
        r4 = r4.b();
        r18 = 1073741824; // 0x40000000 float:2.0 double:5.304989477E-315;
        r4 = r4 / r18;
        r4 = r4 + r7;
    L_0x00df:
        if (r14 != r10) goto L_0x00e3;
    L_0x00e1:
        r7 = r1;
        goto L_0x00e4;
    L_0x00e3:
        r7 = -r1;
    L_0x00e4:
        r4 = r4 + r7;
        if (r2 != r0) goto L_0x0109;
    L_0x00e7:
        r25 = r8;
        r7 = (double) r4;
        r26 = 4611686018427387904; // 0x4000000000000000 float:0.0 double:2.0;
        if (r14 != r10) goto L_0x00fb;
    L_0x00ee:
        r0 = r6.d;
        r0 = r0.r;
        r0 = -r0;
        r28 = r5;
        r4 = (double) r0;
        r4 = r4 / r26;
        r0 = (double) r1;
        r4 = r4 + r0;
        goto L_0x0106;
    L_0x00fb:
        r28 = r5;
        r0 = r6.d;
        r0 = r0.r;
        r4 = (double) r0;
        r4 = r4 / r26;
        r0 = (double) r1;
        r4 = r4 - r0;
    L_0x0106:
        r7 = r7 + r4;
        r0 = (float) r7;
        goto L_0x0124;
    L_0x0109:
        r28 = r5;
        r25 = r8;
        r7 = r4;
        goto L_0x0127;
    L_0x010f:
        r28 = r5;
        r25 = r8;
        if (r2 != r0) goto L_0x0116;
    L_0x0115:
        goto L_0x011d;
    L_0x0116:
        r0 = r6.a;
        r0 = r0.b;
        r0 = r0.left;
        r1 = r1 + r0;
    L_0x011d:
        if (r14 != r11) goto L_0x0126;
    L_0x011f:
        r0 = r6.d;
        r0 = r0.r;
        r0 = r0 + r1;
    L_0x0124:
        r7 = r0;
        goto L_0x0127;
    L_0x0126:
        r7 = r1;
    L_0x0127:
        r0 = r2.ordinal();
        if (r0 == 0) goto L_0x0235;
    L_0x012d:
        r1 = 1;
        if (r0 == r1) goto L_0x0132;
    L_0x0130:
        goto L_0x03a2;
    L_0x0132:
        r0 = r15.ordinal();
        if (r0 == 0) goto L_0x0164;
    L_0x0138:
        if (r0 == r1) goto L_0x0153;
    L_0x013a:
        r1 = 2;
        if (r0 == r1) goto L_0x013f;
    L_0x013d:
        r0 = 0;
        goto L_0x016f;
    L_0x013f:
        if (r13 != r9) goto L_0x0146;
    L_0x0141:
        r0 = r6.a;
        r0 = r0.d;
        goto L_0x014c;
    L_0x0146:
        r0 = r6.a;
        r0 = r0.b;
        r0 = r0.bottom;
    L_0x014c:
        r1 = r6.d;
        r1 = r1.s;
        r1 = r1 + r3;
        r0 = r0 - r1;
        goto L_0x016f;
    L_0x0153:
        r0 = r6.a;
        r0 = r0.d;
        r1 = 1073741824; // 0x40000000 float:2.0 double:5.304989477E-315;
        r0 = r0 / r1;
        r2 = r6.d;
        r3 = r2.s;
        r3 = r3 / r1;
        r0 = r0 - r3;
        r1 = r2.c;
        r0 = r0 + r1;
        goto L_0x016f;
    L_0x0164:
        if (r13 != r9) goto L_0x0168;
    L_0x0166:
        r0 = 0;
        goto L_0x016e;
    L_0x0168:
        r0 = r6.a;
        r0 = r0.b;
        r0 = r0.top;
    L_0x016e:
        r0 = r0 + r3;
    L_0x016f:
        r9 = r0;
        r5 = r28;
        r13 = 0;
        r15 = 0;
        r18 = 0;
    L_0x0176:
        r0 = r5.length;
        if (r15 >= r0) goto L_0x03a2;
    L_0x0179:
        r4 = r5[r15];
        r0 = r4.b;
        r3 = r25;
        if (r0 == r3) goto L_0x0184;
    L_0x0181:
        r22 = 1;
        goto L_0x0186;
    L_0x0184:
        r22 = 0;
    L_0x0186:
        r0 = r4.c;
        r0 = java.lang.Float.isNaN(r0);
        if (r0 == 0) goto L_0x0191;
    L_0x018e:
        r24 = r20;
        goto L_0x0199;
    L_0x0191:
        r0 = r4.c;
        r0 = c.d.a.a.j.g.d(r0);
        r24 = r0;
    L_0x0199:
        if (r22 == 0) goto L_0x01cd;
    L_0x019b:
        if (r14 != r10) goto L_0x01a0;
    L_0x019d:
        r0 = r7 + r18;
        goto L_0x01a4;
    L_0x01a0:
        r0 = r24 - r18;
        r0 = r7 - r0;
    L_0x01a4:
        r25 = r0;
        r26 = r9 + r16;
        r2 = r6.d;
        r0 = r39;
        r8 = r21;
        r1 = r40;
        r21 = r2;
        r2 = r25;
        r28 = r7;
        r7 = r3;
        r3 = r26;
        r26 = r7;
        r7 = r23;
        r23 = r4;
        r29 = r5;
        r5 = r21;
        r0.b(r1, r2, r3, r4, r5);
        if (r14 != r10) goto L_0x01ca;
    L_0x01c8:
        r25 = r25 + r24;
    L_0x01ca:
        r0 = r23;
        goto L_0x01da;
    L_0x01cd:
        r26 = r3;
        r29 = r5;
        r28 = r7;
        r8 = r21;
        r7 = r23;
        r0 = r4;
        r25 = r28;
    L_0x01da:
        r1 = r0.a;
        if (r1 == 0) goto L_0x021e;
    L_0x01de:
        if (r22 == 0) goto L_0x01ea;
    L_0x01e0:
        if (r13 != 0) goto L_0x01ea;
    L_0x01e2:
        if (r14 != r10) goto L_0x01e6;
    L_0x01e4:
        r4 = r7;
        goto L_0x01e7;
    L_0x01e6:
        r4 = -r7;
    L_0x01e7:
        r25 = r25 + r4;
        goto L_0x01ee;
    L_0x01ea:
        if (r13 == 0) goto L_0x01ee;
    L_0x01ec:
        r25 = r28;
    L_0x01ee:
        if (r14 != r11) goto L_0x01f9;
    L_0x01f0:
        r2 = r6.b;
        r1 = c.d.a.a.j.g.c(r2, r1);
        r1 = (float) r1;
        r25 = r25 - r1;
    L_0x01f9:
        r1 = r25;
        if (r13 != 0) goto L_0x0209;
    L_0x01fd:
        r2 = r9 + r12;
        r0 = r0.a;
        r3 = r6.b;
        r5 = r40;
        r5.drawText(r0, r1, r2, r3);
        goto L_0x0217;
    L_0x0209:
        r5 = r40;
        r2 = r12 + r19;
        r9 = r9 + r2;
        r2 = r9 + r12;
        r0 = r0.a;
        r3 = r6.b;
        r5.drawText(r0, r1, r2, r3);
    L_0x0217:
        r0 = r12 + r19;
        r0 = r0 + r9;
        r9 = r0;
        r18 = 0;
        goto L_0x0227;
    L_0x021e:
        r5 = r40;
        r24 = r24 + r8;
        r24 = r24 + r18;
        r18 = r24;
        r13 = 1;
    L_0x0227:
        r15 = r15 + 1;
        r23 = r7;
        r21 = r8;
        r25 = r26;
        r7 = r28;
        r5 = r29;
        goto L_0x0176;
    L_0x0235:
        r5 = r40;
        r8 = r21;
        r26 = r25;
        r29 = r28;
        r0 = 2;
        r28 = r7;
        r7 = r23;
        r1 = r6.d;
        r4 = r1.w;
        r2 = r1.u;
        r1 = r1.v;
        r15 = r15.ordinal();
        if (r15 == 0) goto L_0x0274;
    L_0x0250:
        r21 = r8;
        r8 = 1;
        if (r15 == r8) goto L_0x0266;
    L_0x0255:
        if (r15 == r0) goto L_0x025b;
    L_0x0257:
        r15 = r29;
        r0 = 0;
        goto L_0x027a;
    L_0x025b:
        r0 = r6.a;
        r0 = r0.d;
        r0 = r0 - r3;
        r3 = r6.d;
        r3 = r3.s;
        r0 = r0 - r3;
        goto L_0x0278;
    L_0x0266:
        r0 = r6.a;
        r0 = r0.d;
        r15 = r6.d;
        r15 = r15.s;
        r0 = r0 - r15;
        r15 = 1073741824; // 0x40000000 float:2.0 double:5.304989477E-315;
        r0 = r0 / r15;
        r0 = r0 + r3;
        goto L_0x0278;
    L_0x0274:
        r21 = r8;
        r8 = 1;
        r0 = r3;
    L_0x0278:
        r15 = r29;
    L_0x027a:
        r3 = r15.length;
        r23 = r2;
        r17 = r28;
        r2 = 0;
        r8 = 0;
    L_0x0281:
        if (r8 >= r3) goto L_0x03a2;
    L_0x0283:
        r24 = r7;
        r7 = r15[r8];
        r25 = r3;
        r3 = r7.b;
        r29 = r15;
        r15 = r26;
        if (r3 == r15) goto L_0x0294;
    L_0x0291:
        r26 = 1;
        goto L_0x0296;
    L_0x0294:
        r26 = 0;
    L_0x0296:
        r3 = r7.c;
        r3 = java.lang.Float.isNaN(r3);
        if (r3 == 0) goto L_0x02a1;
    L_0x029e:
        r30 = r20;
        goto L_0x02a9;
    L_0x02a1:
        r3 = r7.c;
        r3 = c.d.a.a.j.g.d(r3);
        r30 = r3;
    L_0x02a9:
        r3 = r1.size();
        if (r8 >= r3) goto L_0x02c3;
    L_0x02af:
        r3 = r1.get(r8);
        r3 = (java.lang.Boolean) r3;
        r3 = r3.booleanValue();
        if (r3 == 0) goto L_0x02c3;
    L_0x02bb:
        r3 = r12 + r19;
        r3 = r3 + r0;
        r17 = r3;
        r0 = r28;
        goto L_0x02c9;
    L_0x02c3:
        r38 = r17;
        r17 = r0;
        r0 = r38;
    L_0x02c9:
        r3 = (r0 > r28 ? 1 : (r0 == r28 ? 0 : -1));
        if (r3 != 0) goto L_0x02f1;
    L_0x02cd:
        if (r13 != r9) goto L_0x02f1;
    L_0x02cf:
        r3 = r4.size();
        if (r2 >= r3) goto L_0x02f1;
    L_0x02d5:
        if (r14 != r11) goto L_0x02e0;
    L_0x02d7:
        r3 = r4.get(r2);
        r3 = (c.d.a.a.j.b) r3;
        r3 = r3.b;
        goto L_0x02e9;
    L_0x02e0:
        r3 = r4.get(r2);
        r3 = (c.d.a.a.j.b) r3;
        r3 = r3.b;
        r3 = -r3;
    L_0x02e9:
        r18 = 1073741824; // 0x40000000 float:2.0 double:5.304989477E-315;
        r3 = r3 / r18;
        r0 = r0 + r3;
        r2 = r2 + 1;
        goto L_0x02f3;
    L_0x02f1:
        r18 = 1073741824; // 0x40000000 float:2.0 double:5.304989477E-315;
    L_0x02f3:
        r31 = r2;
        r2 = r7.a;
        if (r2 != 0) goto L_0x02fc;
    L_0x02f9:
        r32 = 1;
        goto L_0x02fe;
    L_0x02fc:
        r32 = 0;
    L_0x02fe:
        if (r26 == 0) goto L_0x0331;
    L_0x0300:
        if (r14 != r11) goto L_0x0304;
    L_0x0302:
        r0 = r0 - r30;
    L_0x0304:
        r33 = r0;
        r3 = r17 + r16;
        r2 = r6.d;
        r0 = r39;
        r34 = r1;
        r1 = r40;
        r35 = r9;
        r9 = r23;
        r23 = r2;
        r2 = r33;
        r36 = r13;
        r13 = r22;
        r22 = r25;
        r25 = r4;
        r4 = r7;
        r37 = r15;
        r15 = r5;
        r5 = r23;
        r0.b(r1, r2, r3, r4, r5);
        if (r14 != r10) goto L_0x032e;
    L_0x032b:
        r0 = r33 + r30;
        goto L_0x0342;
    L_0x032e:
        r0 = r33;
        goto L_0x0342;
    L_0x0331:
        r34 = r1;
        r35 = r9;
        r36 = r13;
        r37 = r15;
        r13 = r22;
        r9 = r23;
        r22 = r25;
        r25 = r4;
        r15 = r5;
    L_0x0342:
        if (r32 != 0) goto L_0x0376;
    L_0x0344:
        r1 = r24;
        if (r26 == 0) goto L_0x034e;
    L_0x0348:
        if (r14 != r11) goto L_0x034c;
    L_0x034a:
        r4 = -r1;
        goto L_0x034d;
    L_0x034c:
        r4 = r1;
    L_0x034d:
        r0 = r0 + r4;
    L_0x034e:
        if (r14 != r11) goto L_0x0359;
    L_0x0350:
        r2 = r9.get(r8);
        r2 = (c.d.a.a.j.b) r2;
        r2 = r2.b;
        r0 = r0 - r2;
    L_0x0359:
        r2 = r17 + r12;
        r3 = r7.a;
        r4 = r6.b;
        r15.drawText(r3, r0, r2, r4);
        if (r14 != r10) goto L_0x036d;
    L_0x0364:
        r2 = r9.get(r8);
        r2 = (c.d.a.a.j.b) r2;
        r2 = r2.b;
        r0 = r0 + r2;
    L_0x036d:
        if (r14 != r11) goto L_0x0371;
    L_0x036f:
        r3 = -r13;
        goto L_0x0372;
    L_0x0371:
        r3 = r13;
    L_0x0372:
        r0 = r0 + r3;
        r2 = r21;
        goto L_0x0380;
    L_0x0376:
        r1 = r24;
        r2 = r21;
        if (r14 != r11) goto L_0x037e;
    L_0x037c:
        r3 = -r2;
        goto L_0x037f;
    L_0x037e:
        r3 = r2;
    L_0x037f:
        r0 = r0 + r3;
    L_0x0380:
        r8 = r8 + 1;
        r7 = r1;
        r21 = r2;
        r23 = r9;
        r5 = r15;
        r3 = r22;
        r4 = r25;
        r15 = r29;
        r2 = r31;
        r1 = r34;
        r9 = r35;
        r26 = r37;
        r22 = r13;
        r13 = r36;
        r38 = r17;
        r17 = r0;
        r0 = r38;
        goto L_0x0281;
    L_0x03a2:
        return;
        */
        throw new UnsupportedOperationException("Method not decompiled: c.d.a.a.i.d.c(android.graphics.Canvas):void");
    }
}
